package cn.huiyunche.base.service.interfaces;

import cn.huiyunche.base.service.model.SUserAddr;
import cn.huiyunche.base.service.vo.Result;
import cn.huiyunche.base.service.vo.UserAddressVo;
import cn.huiyunche.tools.basic.exceptions.BusinessException;

import java.util.List;

public interface UserAddressService {

    /**
     * 根据ID主键删除数据
     *
     * @param id ID主键
     * @return int
     * @throws BusinessException
     */
    Result<Integer> delUserAddress(Long id) throws Exception;

    /**
     * 添加用户常用地址
     *
     * @param userAddressVo 用户常用地址实体
     * @return int
     * @throws BusinessException
     */
    Long addUserAddress(UserAddressVo userAddressVo) throws Exception;

    /**
     * 添加用户常用地址
     *
     * @return int
     * @throws BusinessException
     */
    Long addUserAddress(String address, String contact, String phone, Boolean isVeneer, String addressType) throws Exception;

    /**
     * 更新用户常用地址
     *
     * @param userAddressVo 用户常用地址实体
     * @return int
     * @throws BusinessException
     */
    int upateUserAddress(UserAddressVo userAddressVo) throws Exception;

    /**
     * 更新用户常用地址
     *
     * @param address
     * @param contact
     * @param phone
     * @param isVeneer
     * @param addressType
     * @param id
     * @return
     * @throws BusinessException
     */
    int upateUserAddress(String address, String contact, String phone, Boolean isVeneer, String addressType, Long id) throws Exception;

    /**
     * 根据地址类型查询用户常用地址
     *
     * @param addressType 地址类型
     * @param isVeneer    是否是同城地址
     * @return List<SUserAddr>
     * @throws BusinessException
     */
    List<SUserAddr> selectUserAddress(String addressType, Boolean isVeneer) throws Exception;

    /**
     * 根据ID更新用户常用地址表默认地址
     *
     * @param id
     * @param isVeneer 用户常用地址ID
     * @return int
     */
    int updateDefaultAddressById(Long id, Boolean isVeneer) throws Exception;

    /**
     * 查询用户默认地址
     *
     * @return List<SUserAddr>
     */
    List<SUserAddr> selectDefaultAddress(Boolean isVeneer, String citycode) throws Exception;

    /**
     * 根据ID查询用户常用地址信息
     *
     * @param id ID主键
     * @return
     * @throws BusinessException
     */
    SUserAddr selectUserAddressById(String id) throws Exception;
}
